<cpanel include="../../config.php">

<?

/***************************************************************************
 *                                 cgi_center_randomhtml_setup.php
 *                            -------------------
 *   Begin                : Thursday, April 16, 2005
 *   Copyright            : (C) 2005 Point and Code
 *   Domain               : http://www.pointandcode.com/
 *   Email                : support@pointandcode.com
 *   Version              : 1.0.0
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

$html_root_path = '../../';
$page_title = "Random HTML Setup";
include $root_path.'common.php';
include $root_path.'page_header.php';

$template->set_filenames(array(
	'body' => $root_path.$template_path.'scripts/cgi_center_randomhtml_setup.tpl')
);

// Unlike the X template, we'll set up randhtml here. Bit pointless if the user's been using X already, but what the hell.
$setup_randhtml = <<<EOFpacman
<cpanel Fileman="installfile("/usr/local/cpanel/cgi-sys/randhtml.cgi-wrap","$homedir/public_html/cgi-bin/randhtml.cgi")">
EOFpacman;

$s_homedir = <<<EOFpacman
<cpanel print="$homedir">
EOFpacman;

$s_file_content = <<<EOFpacman
<cpanel Fileman="fmpushfile($homedir,.randhtml)">
EOFpacman;

$s_hidden_fields = '<input type=hidden name=dir value="'.$s_homedir.'"><input type=hidden name=file value=".randhtml">';

$template->assign_vars(array(
	'S_ACTION' => "cgi_center_randomhtml_setup_done.php",
	'S_HIDDEN_FIELDS' => $s_hidden_fields,
	'S_FILE_CONTENT' => $s_file_content,
	
	'ADDRESS' => $HTTP_GET_VARS['address'],
	'FORWARD' => $HTTP_GET_VARS['forward'],
));

//
// Woohoo! All done!
//
$template->pparse('body');




include $root_path.'page_tail.php';


?>